Skip to content

Consolidate low-signal tests from recent run-records and account work - #958

Merged
kody-bot merged 4 commits into
mainfrom
cursor/test-quality-guidelines-9296
Jul 26, 2026
Merged

kody-bot merged 4 commits into
mainfrom
cursor/test-quality-guidelines-9296

Conversation

@cursor

@cursor cursor Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Agents added many verification tests while shipping run records (#955), account list/detail UIs (#937), invite-cohort readiness (#939), Stripe webhooks (#940), activation funnel (#942), and follow-on Sentry D1 blip carve-outs (#952–#954). This pass folds those suites toward the repo testing principles: fewer longer workflow tests, structured contracts over copy pins, and no one-string-per-filter / duplicate Playwright coverage.

Changes

  • Run records: merge write-surface siblings, cap/stale retention, and alarm lifecycle; drop sandbox level-marker case covered by the sandbox e2e; trim MCP runs to transport smoke + isolation (filter matrix stays in run-records)
  • Console capture / Stripe: fold capture levels + throw into one contract; fold webhook 503 into the main journey; merge signature fixture into verify
  • Sentry/D1: fold UserCodeError + platform keep into filterSentryEvent; trim D1 blip matcher/retry catalogs; fold observability context into the platform-bug journey; delete standalone user-code-error.node.test.ts
  • Account: merge values/memories handlers, activity-data helpers+load, billing refresh without instructional error-copy pins; fold auth-session and alert cron/threshold/cooldown journeys
  • E2E: trim activity instructional empty-state copy; delete memories e2e (values e2e + handler cover the pattern); drop jobs schedule text pin
  • Activation / entitlements / small units: merge activation journeys and package_service_states count+boundary; fold invocation surface/name and workflow sentry tags

Net: 51 fewer test() cases, −667 lines across 23 files. Behavior under test is unchanged.

System recap — composes existing primitives (low risk)

Mode: recap · Base: main @ 0461410a · Head: 9dc9184c

Classification: composes — test-only consolidation; no production behavior, contracts, or primitives changed.

Primitives touched

Primitive Group Impact
run-records storage composes — consolidated write/retention/alarm + MCP runs smoke
app-ui surfaces composes — merged account handlers/data/alerts; trimmed e2e
mcp-server surfaces composes — folded observability + console-capture journeys
billing auth composes — merged Stripe signature + webhook 503 into journeys
entitlements auth composes — folded package_service_states count + boundary
usage-metering storage composes — merged activation workflow
package-runtime runtime composes — folded workflow Sentry scope tags

System map

Test-only cleanup across recent run-records, account UI, billing, and Sentry coverage — no production edges change.

Legend: green = composes (wiring only) · amber = extended by this PR · red = new primitive · gray = context.

flowchart LR
	runRecords["run-records<br/>Run history"]:::touched
	appUi["app-ui<br/>Client UI"]:::touched
	mcpServer["mcp-server<br/>MCP endpoint"]:::touched
	billing["billing<br/>Stripe billing"]:::touched
	entitlements["entitlements<br/>Plan limits"]:::touched
	usage["usage-metering<br/>Usage"]:::touched
	runRecords -.->|test consolidation| mcpServer
	appUi -.->|test consolidation| billing
	mcpServer -.->|test consolidation| usage
	entitlements -.->|test consolidation| runRecords
	classDef touched fill:#1a7f37,color:#fff
	classDef extended fill:#9a6700,color:#fff
	classDef added fill:#cf222e,color:#fff
	classDef untouched fill:#57606a,color:#fff
Loading

Before / after

Before: Fragmented write/retention/alarm siblings, one-string-per-filter Sentry/D1 carve-outs, and Playwright specs that restated handler coverage re-grew after #934.

After: Longer workflow journeys assert structured contracts without pinning instructional copy or duplicating filter matrices across layers.

Risk notes

  • Low risk: tests only; no production code changes.
  • Targeted node and workers unit tests for touched files passed locally before PR open.

Docs

Open in Web View Automation 

cursoragent and others added 3 commits July 26, 2026 09:23
Collapses 32 tests across four files down to 15, following the
'fewer longer workflow tests' principle from testing-principles.md.

run-records.workers.test.ts (20 → 9):
- Merge eager-begin/finish, finish-only upsert, one-shot recordRunRecord,
  waitUntil non-blocking, and execute on-failure policy into a single
  'write surfaces journey' test.
- Delete 'sandbox level markers become structured log levels' — covered
  by the existing sandbox e2e test which already asserts structured
  log levels on each entry.
- Merge retention-priority, cap-protect-running, stale-reconcile,
  stale-cap-evict, and age-cap scenarios into 'cap and stale retention
  journey' (each with its own userId for DO isolation).
- Extend 'write after idle re-arms alarm and age-prunes' into a full
  'alarm lifecycle' narrative that also covers the fresh-arm far-future
  deadline assertion and the self-termination assertion from the two
  standalone alarm tests.

runs.workers.test.ts (5 → 2):
- Keep the auth guard test unchanged.
- Merge run_list filter smoke, run_get with logs/foreign/missing
  rejection, run_summary counts, and run_list/run_summary tenant
  isolation into a single 'run capabilities smoke' test. Filter/
  pagination matrix remains in run-records.workers.test.ts.

execute-console-capture.workers.test.ts (4 → 2):
- Merge success-levels, throw-capture, and unshimmed-methods into
  'console capture contract'; keep 'reused dynamic workers' separate.

stripe-webhooks.workers.test.ts (3 → 2):
- Fold the 503-when-secret-unset guard into the main journey test as
  an upfront check before any seeding.

Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
Collapse post-#934 one-string-per-filter and sibling unit cases toward
fewer longer workflow tests.

- sentry-options: fold UserCodeError hint + platform keep into the main
  filter journey; delete standalone user-code-error.node.test.ts
- d1-retry: keep representative matchers and one retry/fail path
- observability: fold conversationId/storageId/detail context into the
  platform-bug reporting journey
- activation: merge twice-same-package, HTTP ignore, sticky timestamp,
  fast path, and never-throw degradation
- fold stripe signature fixture, package-workflow sentry tags,
  invocation surface/name helpers, and package_service_states count +
  entitlement boundary

Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
Fold post-#937/#939/#940 account verification tests into fewer workflow
journeys and drop low-signal Playwright coverage.

- account-values handler: list/select/save/delete + rejection matrix
- account-memories handler: list/filter/select + soft/force delete
- activity-data helpers + load/cursor; billing refresh workflow without
  instructional error-copy pins
- auth-session password-change matrix; auth-denial and email-delivery
  alert cron/threshold/cooldown journeys
- trim activity e2e instructional empty-state copy; drop memories e2e
  (values e2e + memories handler cover the pattern); drop jobs schedule
  text pin

Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
@kody-bot
kody-bot marked this pull request as ready for review July 26, 2026 09:25
@github-actions

github-actions Bot commented Jul 26, 2026 •

Copy link
Copy Markdown
Contributor

🔎 Preview deployed: https://kody-pr-958.kody-a99.workers.dev

Worker: kody-pr-958
D1: kody-pr-958-db
KV: kody-pr-958-oauth-kv

Mocks:

CI format:check uses oxfmt (tabs/single quotes). A Prettier pass had
rewritten touched test files to spaces/double quotes.

Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
@kody-bot
kody-bot merged commit 405751b into main Jul 26, 2026
8 checks passed
@kody-bot
kody-bot deleted the cursor/test-quality-guidelines-9296 branch July 26, 2026 09:33
kody-bot pushed a commit that referenced this pull request Jul 27, 2026
…982)

* test: consolidate low-signal suites from recent integrations and jobs work

Fold post-#958 verification tests toward fewer longer workflow journeys:
merge OAuth app/setup/prefill matrices, reindex retry pairs, remote-connector
hello/secret lookup outcomes, account jobs filter+e2e journeys, and plan
secret quota cases. Drop the run-history source-scan guardrail and SQL
predicate alias pin; rewrite the package_service_states backfill fixture to
exercise real rescue behavior instead of the empty no-op path.

Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>

* test: reset upsert mock between reindex retry scenarios

The merged D1-retry journey reused the successful upsert spy in the
exhaustion path, so the not-called assertion failed spuriously.

Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants